import {createSlice,createAsyncThunk} from '@reduxjs/toolkit'
import * as services from "services/Translation"
import { addBuilder } from 'store/dict'


export const deginitTranslation = createAsyncThunk<any,number>(
    "Translation/deginitTranslation",
    async(data)=>{
        console.log('111',data);
        const res = services.TranslationList(data)
        
        
        return res
    }
)


const initialState = {
    Translation:{}
}

export const Translation = createSlice({
    name:'Translation',
    initialState,
    reducers:{},
    extraReducers:(buildr)=>{
        console.log("888",buildr);
        
        addBuilder(buildr,deginitTranslation,(state,action)=>{
            console.log("555",state);
            console.log("999",action);
            
        })
    }
})


export default Translation.reducer

export const TranslationSelect = (state:any)=>{
    return state.Translation.Translation
}